
Page({

  /**
   * 页面的初始数据
   */
  data: {
    nav: ['人文', '科学', '自然与工程', '艺术与欣赏'],
    books: {}
  },
  changeNav: function (e) {
    var kind=e.target.id;
    var that=this;
    wx.request({
      url: 'https://55300249.qcloud.la/JapariFriends/searchBook',
      data: {
        condition: 'kind=\'' + kind + '\''
      },
      method: 'get',
      success: function (res) {
        that.setData({
          books:res.data
        })
      }
    })
  },
  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
    var that = this;
    wx.request({
      url: 'https://55300249.qcloud.la/JapariFriends/searchBook',
      data: {
        condition: 'kind=\'人文\''
      },
      method: 'get',
      success: function (res) {
        that.setData({
          books: res.data
        })
      }
    })
  },

})